package com.lcredu.seckill.util.validate;

import java.util.regex.Pattern;

/**
 * @author 黎长容
 * @date 2025-08-23 18:53
 * 验证手机号码匹配格式
 */
public class ValidatorUtil {
    private static final Pattern mobile_pattern = Pattern.compile(
            "^((13[0-9])|(14[57])|(15[0-35-9])|(16[6])|(17[0135678])|(18[0-9])|(19[89]))\\d{8}$"
    );

    public static boolean isMobile(String mobile) {
        //判断是否正确
        if (mobile.equals("") || mobile == null){
            return false;
        }
        
        //判断是否合规
        return mobile_pattern.matcher(mobile).matches();
    }
}
